/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CapadeDatos;
import modelo.beanSexo;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
/**
 *
 * @author clevano
 */
public class DaoVerSexo {

 public static  ArrayList datosSexo(){
        ArrayList lista = new ArrayList();
    try{
            Connection cn = ConexionBD.getInstance().getConnection();
            Statement stm = cn.createStatement();
            String sql ="Call proc_countalumnosxsexo()"; // PROCEDIMIENTO ALMACENADO
            ResultSet rs =stm.executeQuery(sql);
            while (rs.next()){
                   beanSexo modelo  = new beanSexo();
                   modelo.setCodsexo(rs.getString(1));
                   modelo.setCansexos(rs.getInt(2));
                   lista.add(modelo);
            }
    }catch(Exception e)
        {System.out.print(e);
   }return lista;
  }
}

